package com.cbw.bean;

/**
 *  创建bean包的Message实体类，(消息对象)
 *  用于向客户端发送消息(包含状态码、消息内容，消息所携带的一组数据)
 */
public class Message {
    // 客户端以json格式接收消息对象{status:0,result:"",data:{}}

    //状态码: 0成功，-1表示失败
    private int status;
    //消息内容
    private String result;
    //消息所携带的一组数据(object是所有引用类型父类，接收任意类型的数据)
    private Object data;


    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Message(int status, String result) {
        this.status = status;
        this.result = result;
    }

    public Message(String result) {
        this.result = result;
    }

    public Message(int status) {
        this.status = status;
    }

    public Message() {
    }

    public Message(int status, String result, Object data) {
        this.status = status;
        this.result = result;
        this.data = data;
    }
}
